﻿package uk.co.revisual.puremvc.loader.interfaces
{
	import flash.display.*;
	import flash.events.IEventDispatcher;
	
	/**
	Copyright (c) 2008 neil manuell (ta revisual)

	Permission is hereby granted, free of charge, to any person obtaining a copy
	of this software and associated documentation files (the "Software"), to deal
	in the Software without restriction, including without limitation the rights
	to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
	copies of the Software, and to permit persons to whom the Software is
	furnished to do so, subject to the following conditions:
	
	The above copyright notice and this permission notice shall be included in
	all copies or substantial portions of the Software.
	
	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
	THE SOFTWARE.
	
	
	* ...
	* @author neil manuell 
	*/
	public interface IAssetInfo  extends IEventDispatcher
	{
		/**
		 * Indicates whether the asset being held has loaded.
		 * @return 
		 * 
		 */
		function get hasLoaded():Boolean;

		
		/**
		 * the url of the asset
		 * @return 
		 * 
		 */
		function get url():String;
		/**
		 * 
		 * @private
		 * 
		 */
		function set url(param:String):void;
		
		
		/**
		 * the priority for loading. This will be ignored, unless the queSortFunction
		 * has been set on the Loader 
		 * @return 
		 * 
		 */
		function get priority():int;
		/**
		 * 
		 * @private
		 * 
		 */
		function set priority(param:int):void;
		
		/**
		 * idicates whether the asset is stored in the Loader's register 
		 * on a successfull load.  by default it is true;
		 * @param param
		 * 
		 */
		function set store(param:Boolean):void;
		/**
		 * The LoaderContext or SoundLoaderContext to be used for loading
		 * the asset. default is null. 
		 * @param param
		 * 
		 */
		function set context(param:Object):void;
		/**
		 * indicates the loaderClient to use.  The id should match the id it was registered with
		 * in the Loader's registerClient(id:String, c:Class) method
		 * @param param
		 * 
		 */
		function set clientType(param:String):void;
		
		/**
		 * this is basically the url's extention, built by spliting the url with a period 
		 * @return 
		 * 
		 */
		function get fileType():String;
		
		/**
		 * returns the loaded asset 
		 * @return 
		 * 
		 */
		function getAsset():*;
		
		/**
		 * this can be used on any Sprite, or a FlexModule to retrieve a new instance of a class.
		 * For a FlexModule do not pass the name parameter. 
		 * For a Sprite, the name parameter must equal that of the Class Definition Name 
		 * @param name
		 * @return 
		 * 
		 */
		function create(name:String = ""):*
		

	}
	
}